const path = require('path')

module.exports = {
    mode: process.env.NODE_ENV || 'development',
    entry: ['./src/index.js'],
    // experiments: {
    //     outputModule: true
    // },
    output: {
        libraryTarget: 'umd',
        // libraryTarget: 'module',
        libraryExport: 'default',
        path: path.resolve(__dirname, 'dist'),
        // globalObject: 'typeof self !== "undefined" ? self : this'
    },
    module: {
        rules: [
            {
                test: /\.js$/,
                exclude: /node_modules/,
                use: {
                    loader: 'babel-loader',
                    options: {
                        plugins: [
                            '@babel/plugin-proposal-class-properties',
                            '@babel/plugin-transform-classes',
                        ],
                    },
                }
            },
        ],
    },
}